package com.david.cloud.user.controller;


import com.david.cloud.user.entity.Token;
import com.david.cloud.user.service.ITokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/token")
public class TokenController {
    @Autowired
    private ITokenService iTokenService;

    //存在返回true
    @RequestMapping("/get/{token}")
    public Boolean getByToken(@PathVariable String token) {
        Token t = iTokenService.getByToken(token);
        return t != null;
    }

}
